import Vue from 'vue' 
import Vuex from 'vuex' 

import flow from './modules/flow' 
import user from './modules/user' 
import invoice2 from './modules/invoice2' 
import homeStore from './modules/homeStore' 
import fpxxlStore from './modules/fpxxlStore' 
import flowInvoice from './modules/flow-invoice' 
import twoLevelDialogVuex from './modules/twoLevelDialog' 
import manualNegativeInvoice from './modules/manualNegativeInvoice' 
 
Vue.use(Vuex) 

export default new Vuex.Store({ 
  modules: { 
    flow, 
    homeStore, 
    fpxxlStore, 
    user,   
    invoice2, 
    invoice2, 
    flowInvoice, 
    twoLevelDialogVuex, 
    manualNegativeInvoice, 
  }, 
  state: { 
    viewWidth: 0, 
    viewHeight: 0, 
    isRouterAlive:true, 
  }, 
  mutations: {  
    ChangeViewWidth(state, val) { 
      state.viewWidth = val; 
    }, 
    ChangeViewHeight(state, val) { 
      state.viewHeight = val; 
    }, 
    ChangeIsRouterAlive(state, val = false) { 
      state.isRouterAlive = val; 
      setTimeout(()=>{ 
        state.isRouterAlive = !val; 
      },200) 
    }, 
  }, 
  actions: { 
 
  }, 
//   getters 
}) 
